{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "题目一"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A有20个\n",
      "\n",
      "G有17个\n",
      "\n",
      "C有12个\n",
      "\n",
      "T有21个\n",
      "\n"
     ]
    }
   ],
   "source": [
    "list1=list('AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC')\n",
    "num=[0,0,0,0]\n",
    "for i in range(len(list1)):\n",
    "    if(list1[i]=='A'):\n",
    "        num[0]+=1\n",
    "    elif(list1[i]=='G'):\n",
    "        num[1]+=1\n",
    "    elif(list1[i]=='C'):\n",
    "        num[2]+=1\n",
    "    else:\n",
    "        num[3]+=1\n",
    "print(\"A有%d个\\n\"%num[0])\n",
    "print(\"G有%d个\\n\"%num[1])\n",
    "print(\"C有%d个\\n\"%num[2])\n",
    "print(\"T有%d个\\n\"%num[3])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "题目二"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "一个运动员可能得0.25分\n",
      "\n",
      "一个运动员可能得0.50分\n",
      "\n",
      "一个运动员可能得0.75分\n",
      "\n",
      "一个运动员可能得1.00分\n",
      "\n",
      "一个运动员可能得1.25分\n",
      "\n",
      "一个运动员可能得1.50分\n",
      "\n",
      "一个运动员可能得1.75分\n",
      "\n",
      "一个运动员可能得2.00分\n",
      "\n",
      "一个运动员可能得2.25分\n",
      "\n",
      "一个运动员可能得2.50分\n",
      "\n",
      "一个运动员可能得2.75分\n",
      "\n",
      "一个运动员可能得3.00分\n",
      "\n",
      "一个运动员可能得3.25分\n",
      "\n",
      "一个运动员可能得3.50分\n",
      "\n",
      "一个运动员可能得3.75分\n",
      "\n",
      "一个运动员可能得4.00分\n",
      "\n",
      "一个运动员可能得4.25分\n",
      "\n",
      "一个运动员可能得4.50分\n",
      "\n",
      "一个运动员可能得4.75分\n",
      "\n",
      "一个运动员可能得5.00分\n",
      "\n",
      "一个运动员可能得5.25分\n",
      "\n",
      "一个运动员可能得5.50分\n",
      "\n",
      "一个运动员可能得5.75分\n",
      "\n",
      "一个运动员可能得6.00分\n",
      "\n",
      "一个运动员可能得6.25分\n",
      "\n",
      "一个运动员可能得6.50分\n",
      "\n",
      "一个运动员可能得6.75分\n",
      "\n",
      "一个运动员可能得7.00分\n",
      "\n",
      "一个运动员可能得7.25分\n",
      "\n",
      "一个运动员可能得7.50分\n",
      "\n",
      "一个运动员可能得7.75分\n",
      "\n",
      "一个运动员可能得8.00分\n",
      "\n",
      "一个运动员可能得8.25分\n",
      "\n",
      "一个运动员可能得8.50分\n",
      "\n",
      "一个运动员可能得8.75分\n",
      "\n",
      "一个运动员可能得9.00分\n",
      "\n",
      "一个运动员可能得9.25分\n",
      "\n",
      "一个运动员可能得9.50分\n",
      "\n",
      "一个运动员可能得9.75分\n",
      "\n",
      "一个运动员可能得10.00分\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "tuple1=np.arange(0.25,10.25,0.25)\n",
    "for i in range(len(tuple1)):\n",
    "    print(\"一个运动员可能得%.2f分\\n\"%tuple1[i])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "题目三"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "肠粉是广州的一种美食，它的主要原料是米\n",
      "\n",
      "烤鸭是北京的一种美食，它的主要原料是鸭\n",
      "\n",
      "米线是云南的一种美食，它的主要原料是米\n",
      "\n",
      "烩面是河南的一种美食，它的主要原料是小麦\n",
      "\n"
     ]
    }
   ],
   "source": [
    "dict1={\n",
    "    '肠粉':{'城市':'广州','原料':'米'},\n",
    "    '烤鸭':{'城市':'北京','原料':'鸭'},\n",
    "    '米线':{'城市':'云南','原料':'米'},\n",
    "    '烩面':{'城市':'河南','原料':'小麦'}\n",
    "}\n",
    "for key,value in dict1.items():\n",
    "    print(key+\"是\"+value['城市']+\"的一种美食，它的主要原料是\"+value['原料']+\"\\n\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
